import NormalChart from "./components/NormalChart";
import EarthChart from "./components/EarthChart";

function Pane({ meta }) {
  const style = {
    left: meta.x,
    top: meta.y,
    zIndex: meta.z,
  };

  if (meta.type === "custom") {
    return meta.componentType({
      style,
      meta,
    });
  } else if (meta.type === "chart") {
    if (meta.chartType === "normal") {
      return <NormalChart style={style} meta={meta} />;
    } else if (meta.chartType === "earth") {
      return <EarthChart style={style} meta={meta} />;
    }
  }
}

export default Pane;
